
import  time

def show_time(f):
    def inner():
        start = time.time()
        f()
        end = time.time()
        print('spend %s ' %(end - start ))
    return inner

@show_time
def foo():
    print('foo....')
    time.sleep(2)

foo()